package main

import "fmt"

type Mover interface {
	Move()
}
type dog struct {
	name string
}
type car struct {
	brand string
}

// dog类型实现Mover接口
func (d dog) Move() {
	fmt.Printf("%s会跑\n", d.name)
}

// car类型实现Mover接口
func (c car) Move() {
	fmt.Printf("%s速度70迈\n", c.brand)
}

// 多个类型实现同一接口
func main() {
	var x Mover
	var a = dog{name: "d1"}
	var b = car{brand: "b1"}
	x = a
	x.Move()
	x = b
	x.Move()
}
